import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

/* Layout */
import Layout from '@/layout'

export const asyncRouters = [
  {
    path: '/',
    component: Layout,
    redirect: '/',
    name: '首页',
    hidden:false,
    meta: { title: '首页', icon: 'el-icon-s-home' },
    children: [
      {
        path: "",
        name: "系统首页",
        hidden:false,
        component: () => import('@/components/b'),
        meta: { title: '系统首页', icon: 'el-icon-s-home' },
        children: [
          {
            path: '',
            component: () => import('@/views/systemhome/index'),
            name: '系统首页',
            hidden:false,
            meta: { title: '系统首页', icon: 'el-icon-s-home' },
          },
          {
            path: "usersetting",
            name: '账户设置',
            hidden:false,
            component: () => import('@/views/systemhome/usersetting/index'),
            meta: { title: '账户设置', icon: 'el-icon-setting' }
          },
          {
            path: "loginlog",
            name: '登录日志',
            hidden:false,
            component: () => import('@/views/systemhome/loginlog/index'),
            meta: { title: '登录日志', icon: 'el-icon-s-order' }
          },

        ]

      },
      { path: "" }

    ]
  },

  {
    path: '/userAdministrator',
    component: Layout,
    name: '用户',
    hidden:false,
    meta: { title: '用户', icon: 'el-icon-s-custom' },
    children: [
      {
        path: 'innerdr',
        name: '用户管理',
        hidden:false,
        component: () => import('@/components/b'),
        meta: { title: '用户管理', icon: 'el-icon-s-custom' },
        children: [
          {
            path: 'userAdministrator',
            name: '用户列表',
            hidden:false,
            component: () => import('@/views/userAdministrator/userList/index'),
            meta: { title: '用户列表', icon: 'el-icon-s-custom' },

          },
          {
            path: "agencyList",
            name: '代理列表',
            hidden:false,
            component: () => import('@/views/userAdministrator/agencyList/index'),
            meta: { title: '代理列表', icon: 'el-icon-s-check' }
          },
          {
            path: "blacklist",
            name: '黑名单列表',
            hidden:false,
            component: () => import('@/views/userAdministrator/blacklist/index'),
            meta: { title: '黑名单列表', icon: 'el-icon-notebook-2' }
          },
         
        ],
        
      },
      {
        path: "/addUser",
        hidden:true,
        meta:{ add:true},
        component: () => import('@/views/userAdministrator/addUser/index'),
      },
      {
        path: "/userEdit",
        meta:{ add:true},
        hidden:true,
        component: () => import('@/views/userAdministrator/userEdit/index'),
      },
      {
        path: "/examine",
        meta:{ add:true},
        hidden:true,
        component: () => import('@/views/userAdministrator/examine/index'),
      },
      {
        path: "/agencyEdit",
        meta:{ add:true},
        hidden:true,
        component: () => import('@/views/userAdministrator/agencyEdit/index'),
      },
      {
        // 鱼米
        path: '/addEwte',
        name: 'Permission',
        hidden:false,
        component: () => import('@/components/addEwte/index'),
        meta: {
          title: '鱼米',
          icon: 'el-icon-star-off',
        },
        children: [
          {
            // 查询鱼米
            path: '/fishRice',
            component: () => import('@/views/userAdministrator/fishRice/page'),
            name: 'PagePermission',
            hidden:false,
            meta: {
              title: '查询鱼米',
              icon: 'el-icon-star-off'
            }
          },
          {
            path: ''
          }
        ]
      },
      {
        path: ''
      }
    ],


  },



  // 智能渔方
  {
    path: '/smartFish',
    component: Layout,
    name: '智能渔方',
    hidden:false,
    meta: {
      title: '智能渔方',
      icon: 'el-icon-star-off',
    },
    children: [
      {
        path: 'index',
        component: () => import('@/views/smartFish/index'),
        name: '智能渔方',
        hidden:false,
        meta: {
          title: '智能渔方', icon: 'el-icon-s-check'
        },
        children: [
          {
            path: 'index',
            component: () => import('@/views/smartFish/index'),
            name: '智能渔方列表',
            hidden:false,
            meta: {
              title: '智能渔方列表',
              icon: 'el-icon-help',
            },

          },
          {
            path: ''
          }
        ],

      },
      {
        path: "/fishEdits",
        name: '渔方详情',
        meta:{ add:true},
        hidden:true,
        component: () => import('@/views/smartFish/fishEdits/index')
      },
      {
        path: "/editFish",
        name: '渔方编辑',
        meta:{ add:true},
        hidden:true,
        component: () => import('@/views/smartFish/editFish/index')
      },
      {
        path: '',
      },
    ]
  },
  // 水库
  {
    path: '/reservoir',
    component: Layout,
    name: '水库',
    hidden:false,
    meta: { title: '水库', icon: 'el-icon-ship' },
    children: [
      {
        path: 'reservoir',
        name: '水库管理',
        hidden:false,
        component: () => import('@/components/b'),
        meta: { title: '水库管理', icon: 'el-icon-ship' },
        children: [
          {
            path: 'reservoir',
            name: '水库列表',
            hidden:false,
            component: () => import('@/views/reservoir/reservoir/index'),
            meta: { title: '水库列表', icon: 'el-icon-s-operation' },
          },
          {
            path: "addReservoir",
            name: '添加水库',
            hidden:false,
            component: () => import('@/views/reservoir/addReservoir/index'),
            meta: { title: '添加水库', icon: 'el-icon-folder-add' },
          },
         

        ]
      },
      {
        path: "/redact",
        name: '编辑',
        meta:{ add:true},
        hidden:true,
        component: () => import('@/views/reservoir/redact/index'),
      },
      {
        path: "/redactFish",
        name: '详情',
        hidden:true,
        meta:{ add:true},
        component: () => import('@/views/reservoir/redactFish/index'),

      },
      {
        path: "/reservoirEdit",
        name: '水库详情',
        hidden:true,
        meta:{ add:true},
        component: () => import('@/views/reservoir/reservoirEdit/index'),
      },
      {
        path: "/fishEdit",
        name: '渔方详情',
        meta:{ add:true},
        hidden:true,
        component: () => import('@/views/reservoir/fishEdit/index'),
      },
    ],
  },

  // 工单
  {
    path: '/workOrder',
    component: Layout,
    name: '工单',
    hidden:false,
    meta: { title: '工单', icon: 'el-icon-notebook-2' },

    children: [
      {
        path: "innerb",
        name: '工单管理',
        hidden:false,
        component: () => import('@/components/b'),
        meta: { title: '工单管理', icon: 'el-icon-notebook-2' },

        children: [
          {
            path: 'fishPut',
            name: '鱼苗投放工单',
            hidden:false,
            component: () => import('@/views/workOrder/fishPut/index'),
            meta: { title: '鱼苗投放工单', icon: 'el-icon-notebook-1' },
          },
          {
            path: "invoice",
            name: '发票工单',
            hidden:false,
            component: () => import('@/views/workOrder/invoice/index'),
            meta: { title: '发票工单', icon: 'el-icon-s-ticket' }
          },
        ]

      },
      { path: "" }
    ],


  },
  // 订单
  {
    path: '/order',
    component: Layout,
    name: '订单',
    hidden:false,
    meta: { title: '管理', icon: 'el-icon-menu' },
    children: [
      {
        path: 'orderList',
        name: '智能渔方订单',
        hidden:false,
        component: () => import('@/components/b'),
        meta: { title: '智能渔方订单', icon: 'el-icon-menu' },
        children: [
          {
            path: 'orderList',
            name: '订单列表',
            hidden:false,
            component: () => import('@/views/order/orderList/index'),
            meta: { title: '订单列表', icon: 'el-icon-s-order' }
          },
          {
            path: "addOrder",
            name: '添加订单',
            hidden:false,
            component: () => import('@/views/order/addOrder/index'),
            meta: { title: '添加订单', icon: 'el-icon-s-fold' }
          },

        ]
      },
      {
        path: "/orderEdit",
        name: '订单详情',
        meta:{ add:true},
        hidden:true,
        component: () => import('@/views/order/orderEdit/index'),
      },
      {
        path: "",
      }

    ],


  },
  // // 设置
  // {
  //   path: '/settingUp',
  //   component: Layout,
  //   name: '设置',
  //   hidden:false,
  //   meta: { title: '设置', icon: 'el-icon-menu' },
  //   children: [
  //     {
  //       path: 'Carousel',
  //       name: '轮播图设置',
  //       hidden:false,
  //       component: () => import('@/views/settingUp/Carousel/Carousel'),
  //       meta: { title: '轮播图设置', icon: 'el-icon-star-off' },

  //     },
  //     // fisHsettingUp
  //     {
  //       path: 'fisHsettingUp',
  //       name: '智能渔方设置',
  //       hidden:false,
  //       component: () => import('@/views/settingUp/fisHsettingUp/fisHsettingUp'),
  //       meta: { title: '智能渔方设置', icon: 'el-icon-star-off' },

  //     },
  //     {
  //       path: 'orderList',
  //       name: '鱼苗设置',
  //       hidden:false,
  //       component: () => import('@/views/settingUp/fry/fry'),
  //       meta: { title: '鱼苗设置', icon: 'el-icon-edit' }
  //     },
  //     { path: "" },
  //     {
  //       path: "warranty",
  //       name: '保单设置',
  //       hidden:false,
  //       component: () => import('@/views/settingUp/warranty/warranty'),
  //       meta: { title: '保单设置', icon: 'el-icon-star-off' }
  //     },
  //     {
  //       path: "defaultReservoir",
  //       name: '默认水库排序',
  //       hidden:false,
  //       component: () => import('@/views/settingUp/defaultReservoir/defaultReservoir'),
  //       meta: { title: '默认水库排序', icon: 'el-icon-star-off' }
  //     },
  //     {
  //       path: "/orderEdit",
  //       name: '订单详情',
  //       hidden:false,
  //       component: () => import('@/views/order/orderEdit/index'),
  //     },
  //     {
  //       path: "",
  //     }
  //   ],
  // },
// 统计
  {
    path: '/statistics',
    component: Layout,
    name:"统计",
    meta: { title: '统计', icon: 'el-icon-key2' },
    children: [
      {
        path: "innerr",
        name: '统计',
        component: () => import('@/components/b'),
        meta: { title: '统计', icon: 'el-icon-key3' },
        children: [
          {
            path: "innerr",
            name: '用户统计',
            hidden:false,
            component: () => import('@/components/b'),
            meta: { title: '用户统计', icon: 'el-icon-star-off' },
            children: [
              {
                path: 'addUser',
                name: '新增用户',
                hidden:false,
                component: () => import('@/views/statistics/addUser/addUser'),
                meta: { title: '新增用户', icon: 'el-icon-star-off' }
              },
              {
                path: "agencyList",
                name: '活跃用户',
                hidden:false,
                component: () => import('@/views/statistics/activeUser/activeUser'),
                meta: { title: '活跃用户', icon: 'el-icon-star-off' }
              },
            ]
          },
          {
            path: "marketStaistics",
            name: '销售统计',
            hidden:false,
            component: () => import('@/components/b'),
            meta: { title: '销售统计', icon: 'el-icon-star-off' },
            children: [
              {
                path: "marketStaistics",
                name: '消费统计',
                hidden:false,
                component: () => import('@/views/statistics/marketStaistics/index'),
                meta: { title: '消费统计', icon: 'el-icon-star-off' }
              },
            ]
          },
          // {
          //   path: "/index",
          //   name: '"销售统计"',
          //   component: () => import('@/components/b'),
          //   meta: { title: '销售统计', icon: 'el-icon-star-off' },
          //   children: [
          //     {
          //       // 消费统计
          //       path: '/index',
          //       component: () => import('@/views/statistics/marketStaistics/index'),
          //       name: '消费统计',
          //       meta: {
          //         title: '消费统计',
          //         icon: 'el-icon-star-off'
          //       }
          //     },
          //   ]
          // }
        ],
      }
      , 
      {
        path: ""
      }
    ],
  },
  // // 设置
  {
    path: '/settingUp',
    component: Layout,
    name:'设置',
    meta: { title: '设置', icon: 'el-icon-s-tools' },
    children: [
      {
        path: "inned",
        name: '设置',
        component: () => import('@/components/b'),
        meta: { title: '设置', icon: 'el-icon-s-tools' },
        children: [
          {
            path: 'Carousel',
            name: '轮播图设置',
            component: () => import('@/views/settingUp/Carousel/Carousel'),
            meta: { title: '轮播图设置', icon: 'el-icon-star-off' }
          },
          {
            path: "fisHsettingUp",
            name: '智能渔方设置',
            component: () => import('@/views/settingUp/fisHsettingUp/fisHsettingUp'),
            meta: { title: '智能渔方设置', icon: 'el-icon-star-off' }
          },
          {
            path: "fry",
            name: '鱼苗设置',
            component: () => import('@/views/settingUp/fry/fry'),
            meta: { title: '鱼苗设置', icon: 'el-icon-edit' }
          },
          { path: "" },
          {
            path: "warranty",
            name: '保单设置',
            component: () => import('@/views/settingUp/warranty/warranty'),
            meta: { title: '保单设置', icon: 'el-icon-star-off' }
          },
          {
            path: "defaultReservoir",
            name: '默认水库排序',
            component: () => import('@/views/settingUp/defaultReservoir/defaultReservoir'),
            meta: { title: '默认水库排序', icon: 'el-icon-star-off' }
          },
          {
            path: "reservoirTime",
            name: '智能渔方投喂时间',
            component: () => import('@/views/settingUp/reservoirTime/index'),
            meta: { title: '智能渔方投喂时间', icon: 'el-icon-star-off' }
          }
        ]

      },
      { path: "" }
    ],
  },

  // // 管理
  // {
  //   path: '/jurisdiction',
  //   component: Layout,
  //   name: '权限',
  //   hidden:false,
  //   meta: { title: '权限', icon: 'el-icon-key' },
  //   children: [
  //     {
  //       path: 'department',
  //       name: '部门管理',
  //       hidden:false,
  //       component: () => import('@/views/jurisdiction/department/department'),
  //       meta: { title: '部门管理', icon: 'el-icon-notebook-2' }
  //     },
  //     {
  //       path: "member",
  //       name: '成员管理',
  //       hidden:false,
  //       component: () => import('@/views/jurisdiction/member/member'),
  //       meta: { title: '成员管理', icon: 'el-icon-s-custom' }
  //     },
  //     // {
  //     //   path: "operationLog",
  //     //   name: '操作日志',
  //     // hidden:false,
  //     //   component: () => import('@/views/jurisdiction/operationLog/operationLog'),
  //     //   meta: { title: '操作日志', icon: 'el-icon-folder-opened' }
  //     // },
  //     {
  //       path: "jurisdictionSet",
  //       name: '权限设置',
  //       hidden:false,
  //       component: () => import('@/views/jurisdiction/jurisdictionSet/index'),
  //     },
  //   ]
  // },
  {
    path: '/jurisdiction',
    component: Layout,
    name:"权限",
    meta: { title: '权限', icon: 'el-icon-key2' },
    children: [
      {
        path: "innerf",
        name: '权限',
        component: () => import('@/components/b'),
        meta: { title: '权限管理', icon: 'el-icon-key3' },
        children: [
          {
            path: 'department',
            name: '部门管理',
            component: () => import('@/views/jurisdiction/department/department'),
            meta: { title: '部门管理', icon: 'el-icon-notebook-2' }
          },
          {
            path: "member",
            name: '成员管理',
            component: () => import('@/views/jurisdiction/member/member'),
            meta: { title: '成员管理', icon: 'el-icon-s-custom' }
          },
          {
            path: "operationLog",
            name: '操作日志',
            component: () => import('@/views/jurisdiction/operationLog/operationLog'),
            meta: { title: '操作日志', icon: 'el-icon-folder-opened' }
          }
        ]
      }
      , 
      {
        path: ""
      }
    ],
  },
  // { path: '*', redirect: '/404', hidden: true }
]

export const constantRoutes = [
  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
  },

  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  },
  // {
  //   path: '/',
  //   component: Layout,
  //   redirect: '/',
  //   name: '首页',
  //   meta: { title: '首页', icon: 'el-icon-s-home' },
  //   children: [
  //     {
  //       path: "",
  //       component: () => import('@/components/b'),
  //       meta: { title: '系统首页', icon: 'el-icon-s-home' },
  //       children: [
  //         {
  //           path: '',
  //           component: () => import('@/views/systemhome/index'),
  //           meta: { title: '系统首页', icon: 'el-icon-s-home' },
  //         },
  //         {
  //           path: "usersetting",
  //           name: '账户设置',
  //           component: () => import('@/views/systemhome/usersetting/index'),
  //           meta: { title: '账户设置', icon: 'el-icon-setting' }
  //         },
  //         {
  //           path: "loginlog",
  //           name: 'Loginlog',
  //           component: () => import('@/views/systemhome/loginlog/index'),
  //           meta: { title: '登录日志', icon: 'el-icon-s-order' }
  //         },

  //       ]

  //     },
  //     { path: "" }

  //   ]
  // },

  // {
  //   path: '/userAdministrator',
  //   component: Layout,
  //   meta: { title: '用户', icon: 'el-icon-s-custom' },
  //   children: [
  //     {
  //       path: 'inner',
  //       name: '用户',
  //       component: () => import('@/components/b'),
  //       meta: { title: '用户管理', icon: 'el-icon-s-custom' },
  //       children: [
  //         {
  //           path: 'userAdministrator',
  //           name: '用户列表',
  //           component: () => import('@/views/userAdministrator/userList/index'),
  //           meta: { title: '用户', icon: 'el-icon-s-custom' },

  //         },
  //         {
  //           path: "agencyList",
  //           name: '代理列表',
  //           component: () => import('@/views/userAdministrator/agencyList/index'),
  //           meta: { title: '代理列表', icon: 'el-icon-s-check' }
  //         },
  //         {
  //           path: "addUser",
  //           name: '添加用户',
  //           component: () => import('@/views/userAdministrator/addUser/index'),
  //         },
  //         {
  //           path: "userEdit",
  //           name: '编辑用户',
  //           component: () => import('@/views/userAdministrator/userEdit/index'),
  //         },
  //         {
  //           path: "examine",
  //           name: '用户详情',
  //           component: () => import('@/views/userAdministrator/examine/index'),
  //         },
  //       ]
  //     },
  //     // {
  //     //   // 鱼米
  //     //   path: '/inner',
  //     //   name: 'Permission',
  //     //   component: () => import('@/components/addEwte/index'),
  //     //   meta: {
  //     //     title: '鱼米',
  //     //     icon: 'el-icon-star-off',
  //     //   },
  //     //   children: [
  //     //     {
  //     //       // 查询鱼米
  //     //       path: '/fishRice',
  //     //       component: () => import('@/views/userAdministrator/fishRice/page'),
  //     //       name: 'PagePermission',
  //     //       meta: {
  //     //         title: '查询鱼米',
  //     //         icon: 'el-icon-star-off'
  //     //       }
  //     //     },
  //     //     {
  //     //       path: ''
  //     //     }
  //     //   ]
  //     // },
  //     {
  //       path: ''
  //     }
  //   ],


  // },



  // 智能渔方
  // {
  //   path: '/smartFish',
  //   component: Layout,
  //   meta: {
  //     title: '智能渔方',
  //     icon: 'el-icon-star-off',
  //   },
  //   children: [
  //     {
  //       path: 'index',
  //       component: () => import('@/views/smartFish/index'),
  //       name: '智能渔方',
  //       meta: {
  //         title: '智能渔方', icon: 'el-icon-s-check'
  //       },
  //       children: [
  //         {
  //           path: 'index',
  //           component: () => import('@/views/smartFish/index'),
  //           name: '智能渔方列表',
  //           meta: {
  //             title: '智能渔方列表',
  //             icon: 'el-icon-help',
  //           },

  //         },

  //         {
  //           path: ''
  //         }
  //       ],

  //     },
  //     {
  //       path: "/fishEdits",
  //       name: '渔方详情',
  //       component: () => import('@/views/smartFish/fishEdits/index')
  //     },
  //     {
  //       path: '',

  //     },
  //   ]
  // },
  // // 水库
  // {
  //   path: '/reservoir',
  //   component: Layout,
  //   meta: { title: '水库', icon: 'el-icon-ship' },
  //   children: [
  //     {
  //       path: 'reservoir',
  //       name: '水库',
  //       component: () => import('@/components/b'),
  //       meta: { title: '水库管理', icon: 'el-icon-ship' },
  //       children: [
  //         {
  //           path: 'reservoir',
  //           name: '水库列表',
  //           component: () => import('@/views/reservoir/reservoir/index'),
  //           meta: { title: '水库列表', icon: 'el-icon-s-operation' },
  //         },
  //         {
  //           path: "addReservoir",
  //           name: '添加水库',
  //           component: () => import('@/views/reservoir/addReservoir/index'),
  //           meta: { title: '添加水库', icon: 'el-icon-folder-add' },
  //         },
  //         {
  //           path: "redact",
  //           component: () => import('@/views/reservoir/redact/index'),

  //         },
  //         {
  //           path: "redactFish",
  //           component: () => import('@/views/reservoir/redactFish/index'),

  //         },

  //         {
  //           path: "reservoirEdit",
  //           name: '水库详情',
  //           component: () => import('@/views/reservoir/reservoirEdit/index'),

  //         },

  //       ]
  //     },

  //     {
  //       path: "fishEdit",
  //       name: '渔方详情',
  //       component: () => import('@/views/reservoir/fishEdit/index'),

  //     },



  //   ],


  // },

  // // 工单
  // {
  //   path: '/workOrder',
  //   component: Layout,
  //   meta: { title: '工单', icon: 'el-icon-notebook-2' },

  //   children: [
  //     {
  //       path: "inner",
  //       name: '工单',
  //       component: () => import('@/components/b'),
  //       meta: { title: '工单管理', icon: 'el-icon-notebook-2' },

  //       children: [
  //         {
  //           path: 'fishPut',
  //           name: '鱼苗投放工单',
  //           component: () => import('@/views/workOrder/fishPut/index'),
  //           meta: { title: '鱼苗投放工单', icon: 'el-icon-notebook-1' },
  //         },
  //         {
  //           path: "invoice",
  //           name: '发票工单',
  //           component: () => import('@/views/workOrder/invoice/index'),
  //           meta: { title: '发票工单', icon: 'el-icon-s-ticket' }
  //         },
  //       ]

  //     },
  //     { path: "" }






  //   ],


  // },
  // // 订单
  // {
  //   path: '/order',
  //   component: Layout,
  //   meta: { title: '管理', icon: 'el-icon-menu' },
  //   children: [
  //     {
  //       path: 'orderList',
  //       name: '订单',
  //       component: () => import('@/components/b'),
  //       meta: { title: '管理', icon: 'el-icon-menu' },
  //       children: [
  //         {
  //           path: 'orderList',
  //           name: '订单列表',
  //           component: () => import('@/views/order/orderList/index'),
  //           meta: { title: '订单列表', icon: 'el-icon-s-order ' }
  //         },
  //         {
  //           path: "addOrder",
  //           name: '添加订单',
  //           component: () => import('@/views/order/addOrder/index'),
  //           meta: { title: '添加订单', icon: 'el-icon-s-fold ' }
  //         },

  //       ]
  //     },
  //     {
  //       path: "/orderEdit",
  //       name: '订单详情',
  //       component: () => import('@/views/order/orderEdit/index'),
  //     },
  //     {
  //       path: "",
  //     }

  //   ],


  // },
  // 统计
  // {
  //   path: '/statistics',
  //   component: Layout,
  //   name: '统计',
  //   children: [
  //     {
  //       path: "inner",
  //       name: '系统首页',
  //       component: () => import('@/components/b'),
  //       meta: { title: '用户统计', icon: 'el-icon-star-off' },
  //       children: [
  //         {
  //           path: 'addUser',
  //           name: '新增用户',
  //           component: () => import('@/views/statistics/addUser/addUser'),
  //           meta: { title: '新增用户', icon: 'el-icon-star-off' }
  //         },
  //         {
  //           path: "agencyList",
  //           name: '活跃用户',
  //           component: () => import('@/views/statistics/activeUser/activeUser'),
  //           meta: { title: '活跃用户', icon: 'el-icon-star-off' }
  //         },
  //       ]
  //     },
  //     {
  //       path: "inner",
  //       name: '系统首页',
  //       component: () => import('@/components/b'),
  //       meta: { title: '销售统计', icon: 'el-icon-star-off' },
  //       children: [
  //         {
  //           path: 'addUser',
  //           name: '新增用户',
  //           component: () => import('@/views/statistics/addUser/addUser'),
  //           meta: { title: '销售统计', icon: 'el-icon-star-off' },
  //           children: [
  //             {
  //               // 消费统计
  //               path: '/index',
  //               component: () => import('@/views/statistics/marketStaistics/index'),
  //               name: 'PagePermission',
  //               meta: {
  //                 title: '消费统计',
  //                 icon: 'el-icon-star-off'
  //               }
  //             },
  //           ]
  //         },


  //       ]



  //     }



  //   ],
  // },
  // 设置


  // 404 page must be placed at the end !!!
  // { path: '*', redirect: '/404', hidden: true }
]
const createRouter = () => new Router({
  // mode: 'history', // require service support
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes
})

const router = createRouter()


export function resetRouter() {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher // reset router
}

export default router
